﻿using LanguagePolish.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LanguagePolish.EntityModel
{
    partial class Classroom
        : BaseViewModelErrorInfo     // добавляем возможность использования оповещения.
    {
        /// <summary>
        /// Создает правила для валидации.
        /// </summary>
        public override void CreateRules()
        {
            AddRule("Info", () => string.IsNullOrWhiteSpace(Info), "'Class name' can't be empty!");
            AddRule("Capacity", () => !Capacity.HasValue || Capacity.Value <= 0, "'Capacity' must be greater than zero!");
        }
    }
}
